package org.smr.ministore.micro.client;

import org.blade.utils.Pager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smr.ministore.entities.GoodsPriceOrgan;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import feign.hystrix.FallbackFactory;


@Component
public class HystrixGoodsPriceOrganClientFactory implements FallbackFactory<FeignGoodsPriceOrganMicroServiceClient> {

    private static final Logger LOGGER = LoggerFactory.getLogger(HystrixGoodsPriceOrganClientFactory.class);

    @Override
    public FeignGoodsPriceOrganMicroServiceClient create(Throwable cause) {
    HystrixGoodsPriceOrganClientFactory.LOGGER.info("fallback; reason was: {}", cause.getMessage());

        return new FeignGoodsPriceOrganMicroServiceClient() {

            @Override
            public int batchSave(List<GoodsPriceOrgan> entities) {
                return 0;
                }

            @Override
            public int batchModify(List<GoodsPriceOrgan> entities) {
                return 0;
                }

            @Override
            public int save(GoodsPriceOrgan entity) {
            return 0;
            }

            @Override
            public int updateById(GoodsPriceOrgan id) {
            return 0;
            }

            @Override
            public GoodsPriceOrgan queryById(Long id) {
            return null;
            }

            @Override
            public int deleteById(Long id) {
            return 0;
            }

            @Override
            public Pager<GoodsPriceOrgan> paginate(GoodsPriceOrgan entity, Long pageSize, Long pageNum) {
                Pager<GoodsPriceOrgan> pager = new Pager<GoodsPriceOrgan>();
                    return pager;
            }

        };//Return end
    }
}